import request from '@/utils/request'

// 查询省市县镇村数据列表
export function listPosition(query) {
  return request({
    url: '/teaching/position/list',
    method: 'get',
    params: query
  })
}

// 查询省市县镇村数据详细
export function getPosition(id) {
  return request({
    url: '/teaching/position/' + id,
    method: 'get'
  })
}

export function getProvince() {
  return request({
    url: '/teaching/position/',
    method: 'get'
  })
}
export function getCity(provinceId) {
  return request({
    url: '/teaching/position/' + provinceId,
    method: 'get'
  })
}
export function getCounty(cityId) {
  return request({
    url: '/teaching/position/' + cityId,
    method: 'get'
  })
}
export function getTown(countyId) {
  return request({
    url: '/teaching/position/' + countyId,
    method: 'get'
  })
}
export function getVillage(townId) {
  return request({
    url: '/teaching/position/' + townId,
    method: 'get'
  })
}
// 新增省市县镇村数据
export function addPosition(data) {
  return request({
    url: '/teaching/position',
    method: 'post',
    data: data
  })
}

// 修改省市县镇村数据
export function updatePosition(data) {
  return request({
    url: '/teaching/position',
    method: 'put',
    data: data
  })
}

// 删除省市县镇村数据
export function delPosition(id) {
  return request({
    url: '/teaching/position/' + id,
    method: 'delete'
  })
}
